﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Links;
using Base;

public partial class WantLinks : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.bt.Text = Common.GetBottom(bt.Text);
            this.dl.Text = Base.Common.GetBottom(this.dl.Text);
        }
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            TLinks TLink = new TLinks();
            if (radLinkType.Checked == true)
            {
                TLink.LinkType = int.Parse(radLinkType.Value);
            }
            else
            {
                TLink.LinkType = int.Parse(radLinkType1.Value);
            }
            TLink.WebName = txtWebName.Text;
            TLink.WebURL = txtWebURL.Text;
            if (radLinkType.Checked == true)
            {
                TLink.WebLOGO = ImgUrl1.Value;
            }
            else
            {
                TLink.WebLOGO = ImgUrl.Src;
            }
            TLink.WebIntro = txtWebIntro.Text;
            TLink.WebAdmin = txtWebAdmin.Text;
            TLink.Email = txtEmail.Text;
            TLink.Verify = false;
            ILinks RLink = new RLinks();
            RLink.Insert(TLink);
            ShowMessage("友情链接申请成功！,请等待管理员审核!", "../Default.aspx");
        }
        catch (Exception ex)
        {
            //ShowMessage(ex.Message);
        }
    }

    protected void btnCancel_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}
